home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / loader / initrd / initrd 32493 / etc / udev / rules.d / 60-persistent-storage.rules < prev    next >
Text File  |  2006-11-29  |  3KB  |  54 lines

  1. # persistent storage links: /dev/{disk,tape}/{by-id,by-uuid,by-label,by-path,by-name}
  2. # scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de>
  3.  
  4. ACTION!="add", GOTO="persistent_storage_end"
  5. SUBSYSTEM!="block", GOTO="persistent_storage_end"
  6.  
  7. # skip rules for inappropriate block devices
  8. KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-*|md*", GOTO="persistent_storage_end"
  9.  
  10. # never access non-cdrom removable ide devices, the drivers are causing event loops on open()
  11. KERNEL=="hd*[!0-9]", ATTR{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end"
  12. KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GOTO="persistent_storage_end"
  13.  
  14. # for partitions import parent information
  15. KERNEL=="*[0-9]", IMPORT{parent}="ID_*"
  16.  
  17. # by-id (hardware serial number)
  18. KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
  19. KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
  20. KERNEL=="hd*[0-9]", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
  21.  
  22. KERNEL=="sd*[!0-9]|sr*|st*", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"
  23. KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="usb_id -x"
  24. KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
  25. KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
  26. KERNEL=="dasd*[!0-9]", IMPORT{program}="dasd_id --export $tempnode"
  27. KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
  28. KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
  29. KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", ENV{ID_VENDOR}=="ATA", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL_SHORT}"
  30. KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", ENV{ID_VENDOR}=="ATA", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL_SHORT}-part%n"
  31. KERNEL=="st*", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
  32.  
  33. KERNEL=="mmcblk[0-9]", ATTR{name}=="?*", ATTR{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}"
  34. KERNEL=="mmcblk[0-9]p[0-9]", ATTR{name}=="?*", ATTR{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n"
  35.  
  36. # by-path (shortest physical path)
  37. KERNEL=="*[!0-9]|sr*", IMPORT{program}="path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
  38. KERNEL=="st*", IMPORT{program}="path_id %p", SYMLINK+="tape/by-path/$env{ID_PATH}"
  39. KERNEL=="sr*|st*", GOTO="persistent_storage_end"
  40. KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
  41.  
  42. # by-label/by-uuid (filesystem properties)
  43. KERNEL=="*[!0-9]", ATTR{removable}=="1", GOTO="persistent_storage_end"
  44. IMPORT{program}="vol_id --export $tempnode"
  45. ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
  46. ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
  47.  
  48. # BIOS Enhanced Disk Device
  49. KERNEL=="*[!0-9]", IMPORT{program}="edd_id --export $tempnode"
  50. KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
  51. KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n"
  52.  
  53. LABEL="persistent_storage_end"
  54.